DevJourney

Python/RegEx/Extract consecutive 2 characters of a statement excluding spaces/re.findall().py

import re

s = str(input("Enter a string: "))
res = re.findall(r'\w{1,2}',s)
print(res)
View on GitHub